// components/navbar/index.js
const app = getApp();
Component({
  properties: {
    showHome: {
      type: Boolean,
      value: false
    }
  },
  data: {

  },
  attached: function () {
    var that = this;
    var menu = app.globalData.menuTitle;
    var tabbarPage = [];
    for (var i in menu) {
      tabbarPage.push(i);
    }
    console.log(tabbarPage);
    var path = getCurrentPages()[getCurrentPages().length - 1].__route__;
    var isTabPage = false;
    for (var i=0;i<tabbarPage.length;i++){
      if (tabbarPage[i] == path){
        isTabPage = true;
      }
    }
    that.setData({
      isTabPage: isTabPage
    })
    console.log(isTabPage);
    var enterFrom = app.globalData.enterFrom;
    if (!isTabPage){
      that.setData({
        showSy:true
      })
    }
  },
  methods: {
    navBack: function () {
      wx.navigateBack({
        delta: 1
      })
    },
    toIndex: function () {
      app.globalData.enterFrom = '';
      // app.backHome();
      wx.redirectTo({
        url: '/pages/index/index',
      })
    },
  }
})